<?php include $this->getViewFile('/common/Head') ?>
<body class="J_scroll_fixed">
<style>
.col-left{float:left}
.col-auto{overflow:hidden;_zoom:1;_float:left;}
.title-1{border-bottom:1px solid #eee; padding-left:5px}
.f14{font-size: 14px}
.lh28{line-height: 28px}
.blue,.blue a{color:#004499}
.gray4,a.gray4{color:#999;}
.lh22{line-height: 22px}
.lh25{line-height: 25px}
</style>
<div class="wrap J_check_wrap">
  <?php include $this->getViewFile('/common/Nav') ?>
  <div class="h_a">查找</div>
  <form method="post" action="" id="searchForm">
    <div class="search_type cc mb10">
      <div class="mb10"> 
        状态：<?php echo Form::select(array(1=>'审核通过',2=>'未通过',4=>'手动上传'),$action_type,'name="action_type"','全部') ?>
        审核时间：
        <input type="text" name="start_time" class="input length_2 J_date" value="<?php echo $start_time?>" placeholder="选择起始时间">
        -
        <input type="text" class="input length_2 J_date" name="end_time" value="<?php echo $end_time?>" placeholder="选择结束时间">
       </div>
       <div class="mb10">
        审核人 ：
        <?php
		$adminList = array();
		foreach(AdminUser::model()->getUserList() as $rs){
			$adminList[$rs['admin_id']] = $rs['real_name'];
		}
		?>
        <?php echo Form::select($adminList,$admin_id,'name="admin_id"','全部') ?>
        商品ID：
        <input type="text" class="input length_2" name="product_id" style="width:200px;" value="<?php echo $product_id?>" placeholder="请输入商品ID...">
        <button class="btn">搜索</button>
      </div>
      <div class="mb10">
      <?php
	  if(ACTION_NAME == 'check'){
	  ?>
      <a href="<?php echo AdminBase::U("check",array('getcheck'=>1)) ?>"><b><font color="#FF0000">点击获取新的需要审核的宝贝数据</font></b></a>
      (注意：最多只能有<?php echo $this->waitHeckSum?>条处在审核中的数据)
      <?php
	  }
	  ?>
      </div>
    </div>
  </form>
  <div class="mb10"> 共有 ( <b><?php echo $count; ?></b> ) 条记录</div>
  <form name="myform" action="<?php echo AdminBase::U("delete") ?>" method="post" class="J_ajaxForm">
    <div class="table_list">
      <table width="100%" cellspacing="0">
        <thead>
          <tr>
            <td width="100" align="center"><input type="checkbox" class="J_check_all" data-direction="x" data-checklist="J_check_x">
              全选</td>
            <td width="100" align="center">商品ID</td>
            <td align="center">商品报名信息</td>
            <td width="100" align="center">审核结果</td>
            <td width="120" align="center">审核时间</td>
            <td width="100" align="center">审核人</td>
          </tr>
        </thead>
        <tbody>
         <?php
		 foreach($data as $rs){
		 ?>
         <tr>
            <td><input type="checkbox" class="J_check" data-yid="J_check_y" data-xid="J_check_x" name="ids[]" value="<?php echo $rs['id'];?>" id="att_<?php echo $rs['id'];?>" /><?php echo $rs['id'];?></td>
            <td align="center"><?php echo $rs['product_id']?></td>
            <td>
            <div class="col-left mr10" style="width:146px; height:112px"><a href="<?php echo $rs['item']['detail_url']?>" target="_blank"><img src="<?php echo $rs['item']['product_img']?>" width="146" height="112" style="border:1px solid #eee" align="left"></a></div>
            <div class="col-auto">
                  <h2 class="title-1 f14 lh28 mb6 blue"><a href="<?php echo $rs['item']['detail_url']?>" target="_blank"><?php echo $rs['item']['goods_name'] ?></a>
                   </h2>
                  <p class="gray4 lh25">
                  原价：<font color="#FF0000"><?php echo  number_format($rs['p_price'],2)?></font>， 
                  活动价：<font color="#FF0000"><?php echo  number_format($rs['promo_price'],2)?></font>，
                   旺旺：<b><a href="http://amos.im.alisoft.com/msg.aw?v=2&amp;site=cntaobao&amp;s=2&amp;charset=utf-8&amp;uid=<?php echo urlencode($rs['item']['nick'])?>" target="_blank"><?php echo $rs['item']['nick']?><img src="http://amos.im.alisoft.com/online.aw?v=2&amp;site=cntaobao&amp;s=2&amp;charset=utf-8&amp;uid=<?php echo urlencode($rs['item']['nick'])?>" alt=""></a></b>
                  </p>
                  <p class="gray4 lh25">
                  上架时间：<font color="#FF33FF"><?php echo $rs['item']['start_time']?date('Y-m-d H:i:s',$rs['item']['start_time']):'/'; ?></font> ，
                  下架时间：<font color="#FF33FF"><?php echo $rs['item']['end_time']?date('Y-m-d H:i:s',$rs['item']['end_time']):'/'; ?></font>
                  </p>
                </div>
            </td>
            <td align="center"><?php echo (int)$rs['action_type']?GoodsActionModel::model()->getStatusTags((int)$rs['action_type']):''; ?></td>
            <td align="center"><?php echo date('Y-m-d H:i:s',$rs['action_time']) ?></td>
            <td align="center"><?php echo GoodsBmModel::model()->getByUidFindName($rs['admin_id']) ?></td>
          </tr>
         <?php
		 }
		 ?>
        </tbody>
      </table>
      <div class="p10">
        <div class="pages"><?php echo $Page;?></div>
      </div>
    </div>
    <div class="btn_wrap" style="display:none;">
      <div class="btn_wrap_pd">
        <label class="mr20">
          <input type="checkbox" class="J_check_all" data-direction="y" data-checklist="J_check_y">
          全选</label>
        <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('Special/listorder')}">排序</button>
        <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('Special/delete')}">删除</button>
        <button class="btn J_ajax_submit_btn btn_submit" type="submit" data-action="{:U('Special/html')}">更新HTML</button>
      </div>
    </div>
  </form>
</div>
<script src="<?php echo $staticUrl; ?>statics/js/common.js?v"></script>
<script>
//快速编辑
function fastEdit(gid) {
    Wind.use("artDialog", "iframeTools", function () {
		var dialog = art.dialog({
		    title: '快速编辑',
            id: 'fastEdit',
            lock: true,
            fixed: true,
			width:600,
			height:560,
            background: "#CCCCCC",
			padding:'5px 5px',
            opacity: 0
		});
		$.get("<?php echo AdminBase::U("editor") ?>",{ajax:1,goods_id:gid},function(data){
			 dialog.content(data);
		});
        /*art.dialog.open('<?php echo AdminBase::U("editor") ?>?ajax=1&goods_id='+gid, {
            title: '快速编辑',
            id: 'fastEdit',
            lock: true,
            fixed: true,
			width:600,
			height:560,
            background: "#CCCCCC",
            opacity: 0
        });*/
    });
}
$(function(){
	//只显示本人正在审核的和未审核的报名商品
	if($('input#J_mycheck').length){
		$('input#J_mycheck').click(function(){
			$('#searchForm').submit();
		});
	}
	//点击进行审核，
	/*if($('.J_ajax_admin_check').length){
		$('.J_ajax_admin_check input').click(function(){
			var obj = $(this).parent().parent();
			var gid = obj.data('gid');
			Wind.use("artDialog", function (){
				$.get("<?php echo AdminBase::U("admin_check") ?>",{goods_id:gid},function(data){
					if(data.status){
						obj.html('<?php echo '<font color="#0033FF">'.AdminBase::$userInfo['real_name']."</font>正在审核中"; ?>');
					}else{
						art.dialog({
							icon: 'error',
							content: data.info
						});
					}
				},'json');
			});
		});
	}*/
});
</script>
</body>
</html>